# -- coding: utf-8 --

import json

object = {'name':'xx','age':18}
print(object)
print(type(object))
string = json.dumps(object)

print(type(string))
print(string)


# file = open('example.txt','w')
# json.dump(object,file)
#file.close

file1 = open('test.txt','r')
a = json.load(file1)
print(a['name'])
print(a['age'])